package gui;

import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.geom.GeneralPath;

public class Draw {

	public static void crossHair(Graphics2D g2, int x, int y, int TICK, boolean cross, boolean circle) {
		if (circle) {
			g2.drawOval(x - TICK, y - TICK, 2 * TICK, 2 * TICK);
		}
		if (cross) {
			g2.drawLine(x, y - TICK * 2, x, y + TICK * 2);
			g2.drawLine(x - TICK * 2, y, x + TICK * 2, y);
		}
	}

	public static void triangle(Graphics2D g, double x, double y, double theta, double epsilon, double r) {
		GeneralPath p = new GeneralPath();
		p.moveTo(x, y);
		p.lineTo(x - r * Math.cos(theta + epsilon), y - r * Math.sin(theta + epsilon));
		p.lineTo(x - r * Math.cos(theta - epsilon), y - r * Math.sin(theta - epsilon));
		g.fill(p);
	}

	public static Color brigter(Color col, double d) {
		return new Color(Math.max((int) (col.getRed() * d), 0), Math.max((int) (col.getGreen() * d), 0), Math.max((int) (col.getBlue() * d), 0), col.getAlpha());
	}

}
